* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    overflow: hidden;
}

.container {
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas: 
        "header header"
        "nav main";
    height: 100vh;
}

header {
    grid-area: header;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

header p {
    color: #7f8c8d;
    font-size: 1.1em;
}

.controls-panel {
    grid-area: nav;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.controls-panel h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
    text-align: center;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.control-section {
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(248, 249, 250, 0.8);
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.control-section h4 {
    color: #34495e;
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.control-group input[type="range"] {
    width: 100%;
    margin-bottom: 5px;
    accent-color: #3498db;
}

.control-group span {
    display: inline-block;
    background: #ecf0f1;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #2c3e50;
    min-width: 40px;
    text-align: center;
}

.control-group input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #3498db;
}

/* 通道按钮样式 */
.channel-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.channel-btn {
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #ecf0f1 0%, #bdc3c7 100%);
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.channel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.channel-btn.active {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.channel-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.channel-btn:hover::before {
    left: 100%;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    width: 100%;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

main {
    grid-area: main;
    position: relative;
    background: #2c3e50;
}

#scene-container {
    width: 100%;
    height: 100%;
}

.info-panel {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 10px;
    max-width: 400px;
    max-height: 60vh;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.info-panel h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2em;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.channel-detail {
    display: none;
    background: rgba(248, 249, 250, 0.8);
    border-left: 4px solid #e74c3c;
    padding: 15px;
    border-radius: 0 8px 8px 0;
    transition: all 0.3s ease;
}

.channel-detail.active {
    display: block;
    animation: fadeInUp 0.5s ease;
}

.channel-detail h4 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: 600;
}

.channel-detail p {
    margin: 8px 0;
    font-size: 0.9em;
    line-height: 1.5;
    color: #34495e;
}

.channel-detail p strong {
    color: #2c3e50;
    font-weight: 600;
}

/* 不同通道类型的颜色主题 */
.channel-detail[data-channel="diffuse"] {
    border-left-color: #e74c3c;
}

.channel-detail[data-channel="normal"] {
    border-left-color: #9b59b6;
}

.channel-detail[data-channel="roughness"] {
    border-left-color: #f39c12;
}

.channel-detail[data-channel="metalness"] {
    border-left-color: #95a5a6;
}

.channel-detail[data-channel="emission"] {
    border-left-color: #f1c40f;
}

.channel-detail[data-channel="displacement"] {
    border-left-color: #16a085;
}

.channel-detail[data-channel="occlusion"] {
    border-left-color: #34495e;
}

/* 滚动条样式 */
.controls-panel::-webkit-scrollbar,
.info-panel::-webkit-scrollbar {
    width: 8px;
}

.controls-panel::-webkit-scrollbar-track,
.info-panel::-webkit-scrollbar-track {
    background: rgba(240, 240, 240, 0.5);
    border-radius: 4px;
}

.controls-panel::-webkit-scrollbar-thumb,
.info-panel::-webkit-scrollbar-thumb {
    background: rgba(52, 152, 219, 0.6);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.controls-panel::-webkit-scrollbar-thumb:hover,
.info-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 152, 219, 0.8);
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 280px 1fr;
    }
    
    .info-panel {
        max-width: 350px;
    }
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr;
        grid-template-areas: 
            "header"
            "nav"
            "main";
    }
    
    .controls-panel {
        max-height: 200px;
        padding: 15px;
    }
    
    .info-panel {
        position: relative;
        bottom: auto;
        right: auto;
        margin: 10px;
        max-width: none;
        max-height: 300px;
    }
    
    main {
        min-height: 400px;
    }
}